/**
 * 
 */

package cn.cn77.futures.utils;

/**
 * @author sun
 */
public class C2Sever {

	/**
	 * 服务器URL地址前缀
	 */
	public static final String URL = "http://www.168f16.com/home/";

	public static final String UpdateInfoUrl = "updateurl";

	public static final String VersionCode = "versioncode";

	/**
	 * 通过控制器和Action拼接出URL
	 * 
	 * @param controller
	 * @param action
	 * @return
	 */
	public static String getUrl(String controller, String action) {
		return C2Sever.URL + controller + "/" + action;
	}

	/**
	 * 服务器控制器
	 * 
	 * @author sun
	 */
	public static class Controller {
		/**
		 * 更新控制器
		 */
		public static final String Update = "Index";
		/**
		 * 服务器的默认控制器，未登录状态下
		 */
		public static final String User = "User";
		/**
		 * 说明页面
		 */
		public static final String Introduction = "Shuoming";
		/**
		 * 成功率计算页面
		 */
		public static final String SuccessRate = "Probability";
		/**
		 * 新增产品页面
		 */
		public static final String NewProduct = "Product";
	}

	/**
	 * 每个网络操作在服务器对应的处理方法
	 * 
	 * @author sun
	 */
	public static class Action {
		/**
		 * 更新Action
		 */
		public static final String Update = "getversion";
		/**
		 * 登录方法
		 */
		public static final String Login = "login";
		/**
		 * 新建产品页面获取数据的方法
		 */
		public static final String NewProduct = "qihuo";
		/**
		 * 获取使用说明
		 */
		public static final String Introduction = "getcontent";
		/**
		 * 成功率
		 */
		public static final String SuccessRate = "getpro";

	}

	/**
	 * 与服务器交互的字段，尽量与数据库保持一致
	 * 
	 * @author sun
	 */
	public static class Field {
		/**
		 * 用户id
		 */
		public static final String Uid = "uid";
		public static final String Success = "success";
		public static final String Message = "msg";
		public static final String Other = "other";
		public static final String Data = "data";
		public static final String PostCode = "postcode";
		protected static final String ApkName = "apkname";

		/**
		 * 登录用字段
		 * 
		 * @author 振朝
		 */
		public static class Login {

			/**
			 * 用户手机号
			 */
			public static final String Phone = "username";
			/**
			 * 用户登录密码
			 */
			public static final String Password = "userpass";
			/**
			 * 登录时间戳
			 */
			public static final String TimeStamp = "lasttime";

		}

		/**
		 * 新建产品用的字段
		 * 
		 * @author 振朝
		 */
		public static class NewProduct {

			/**
			 * 产品Id
			 */
			public static final String ProuductId = "pid";
			/**
			 * 振动：00表示短震，01表示长震
			 */
			public static final String Vibrator = "zd";
			/**
			 * 操作字段
			 */
			public static final String Operation = "content";
			/**
			 * 发送操作代码表 涨、跌、删除
			 */
			public static final String[] Operations = { "1", "-1", "del" };

			/**
			 * 状态;
			 */
			public static final String State = "status";
			public static final String EndTime = "endtime";

		}

		/**
		 * 成功率显示页面用的字段
		 * 
		 * @author 振朝
		 */
		public static class SuccessRate {

			/**
			 * 会员Id
			 */
			public static final String MemberId = "mid";
			/**
			 * 日期
			 */
			public static final String Date = "addtime";
			/**
			 * 总计删除次数
			 */
			public static final String SumDelTimes = "totaldelnum";
			/**
			 * 总次数
			 */
			public static final String SumTimes = "onetotalnumber";
			/**
			 * 下单次数
			 */
			public static final String OrderTimes = "onetsnumber";
			/**
			 * 删除次数
			 */
			public static final String DelTimes = "onedelnumber";
			/**
			 * 成功次数
			 */
			public static final String SuccessTimes = "onecgnumber";
			/**
			 * 开始时间
			 */
			public static final String StartTime = "starttime";
			/**
			 * 结束时间
			 */
			public static final String EndTime = NewProduct.EndTime;
			/**
			 * 序号
			 */
			public static final String Number = "onepid";

		}
	}

}
